{% extends 'base/base1.html' %}
{% load static %}

{% block title %}更新订单状态{% endblock %}

{% block css %}
<style>
    .update-form {
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 30px;
        max-width: 600px;
        margin: 0 auto;
    }
</style>
{% endblock %}

{% block main %}
<div class="container-fluid">
    <div class="update-form">
        <h2 class="text-center mb-4">更新订单状态</h2>
        
        <div class="mb-4">
            <h5>订单信息</h5>
            <p><strong>订单号：</strong>{{ object.order_number }}</p>
            <p><strong>用户：</strong>{{ object.user.username }}</p>
            <p><strong>当前状态：</strong>{{ object.get_status_display }}</p>
            <p><strong>订单金额：</strong>￥{{ object.total_amount }}</p>
        </div>
        
        <form method="post">
            {% csrf_token %}
            <div class="form-group">
                <label for="{{ form.status.id_for_label }}">新状态：</label>
                {{ form.status }}
            </div>
            
            <div class="form-group text-center">
                <button type="submit" class="btn btn-primary">更新状态</button>
                <a href="{% url 'main:order_detail' object.pk %}" class="btn btn-secondary">取消</a>
            </div>
        </form>
    </div>
</div>
{% endblock %}